home *** CD-ROM | disk | FTP | other *** search
/ Disc to the Future 2 / Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin / MAC / MPW_TOOL / TOOLS / TOOLS_WI / ICON_8 / MEMMON_F / MEMMON.H < prev    next >
Text File  |  1990-03-02  |  3KB  |  108 lines

  1. /*
  2.  * memmon.h: general memmon definitions.
  3.  */
  4.  
  5. #include "::h:config.h"
  6. #include "mproto.h"            /* memmmon function prototypes */
  7. #include "msymbols.h"            /* color labels and definitions */
  8.  
  9. #ifndef Global
  10. #define Global extern
  11. #endif                    /* Global */
  12.  
  13. /*
  14.  * Manifest constants.
  15.  */
  16. #define LineSize 100            /* size for line buffers */
  17.  
  18. #define TextLength 112            /* prompt/legend line size */
  19.  
  20. #define TextLines 2            /* number of such lines */
  21.  
  22. #define StatusLength 35            /* size of the status message */
  23. #define RegionLength 35            /* typical max for the region display */
  24. #define TitleLength (TextLength - StatusLength - RegionLength)
  25.  
  26. #define SpaceCode '-'            /* special code for spacing legend */
  27.  
  28. /*
  29.  * Command options.
  30.  */
  31. Global char *progname;            /* program name, for diagnostics etc. */
  32.  
  33. Global int showmarking;            /* show marking phase? */
  34. Global int gclimit;            /* quit after this many gc's */
  35. Global int pauselimit;            /* quit after this many pauses */
  36.  
  37. Global char *whenpause;            /* when to pause */
  38. Global char *whichregs;            /* which regions to display */
  39.  
  40. Global char *title;            /* display title */
  41.  
  42. /*
  43.  * Output parameters.  Some of these are changeable by command option;
  44.  *  not all devices honor such changes.  Others are calculated.
  45.  */
  46. Global int granularity;            /* display granularity */
  47. Global int sfreq;            /* screen frequency for PostScript */
  48. Global int width, height;        /* output image size, in pixels */
  49. Global int textrow;            /* output height of a legend box */
  50. Global int textsep;            /* pixels separating legend from mem */
  51. Global int memrow;            /* height of one memory row */
  52.                     /* (can decrease but not increase) */
  53. Global int batchmode;            /* nonzero if batch mode output */
  54.  
  55. Global int memheight;            /* height of the memory region */
  56. Global word mempixels;            /* total horizontal memory pixels */
  57. Global int ymin;            /* minimum y value actually used */
  58.  
  59. /* 
  60.  * The current color map, in three sections.
  61.  *  The first section remains constant, once initialized.
  62.  *  The second sections colors unmarked blocks.
  63.  *  The third section colors marked blocks.
  64.  *  Colors in the second and third sections change dynamically during g.c.
  65.  */
  66. #define MapSize (3*NColors)        /* color map size */
  67. #define Unmarked NColors        /* offset to unmarked colors */
  68. #define Marked    (2*NColors)        /* offset to marked colors */
  69.  
  70. Global struct {
  71.    unsigned char red;            /* primary color components 0 - 255 */
  72.    unsigned char green;
  73.    unsigned char blue;
  74.    unsigned char uniq;            /* lowest numbered identical color */
  75.    } cmap[MapSize];
  76.  
  77. Global word blkcolor[256];        /* block entry, indexed by key char */
  78.  
  79. /*
  80.  * Region information.
  81.  */
  82.  
  83. struct region {
  84.    word base;        /* base address */
  85.    word used;        /* memory used */
  86.    word length;        /* region size */
  87.    word displ;        /* length displayed */
  88.    word saddr;        /* screen address */
  89.    };
  90.  
  91. Global struct region stc;        /* static region information */
  92. Global struct region str;        /* string region information */
  93. Global struct region blk;        /* block region information */
  94.  
  95. /*
  96.  * Miscellaneous global variables.
  97.  */
  98.  
  99. Global word ncollect;            /* total garbage collections */
  100. Global word nstatic, nstring, nblock, nexplicit;  /* region totals */
  101.  
  102. Global FILE *ifile;            /* input file */
  103. Global FILE *ttyi, *ttyo;        /* tty file for prompts & acks */
  104.  
  105. /*
  106.  * Redefinitions
  107.  */
  108.